package cn.iocoder.yudao.module.mqtt.dal.mysql.devicelatestflowlog;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.mqtt.dal.dataobject.devicelatestflowlog.DeviceLatestFlowLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mqtt.controller.admin.devicelatestflowlog.vo.*;

/**
 * 水量日志 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface DeviceLatestFlowLogMapper extends BaseMapperX<DeviceLatestFlowLogDO> {

    default PageResult<DeviceLatestFlowLogDO> selectPage(DeviceLatestFlowLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceLatestFlowLogDO>()
                .eqIfPresent(DeviceLatestFlowLogDO::getDeviceId, reqVO.getDeviceId())
                .likeIfPresent(DeviceLatestFlowLogDO::getDeviceName, reqVO.getDeviceName())
                .eqIfPresent(DeviceLatestFlowLogDO::getDeviceKey, reqVO.getDeviceKey())
                .eqIfPresent(DeviceLatestFlowLogDO::getGatewayId, reqVO.getGatewayId())
                .eqIfPresent(DeviceLatestFlowLogDO::getLisDay, reqVO.getLisDay())
                .eqIfPresent(DeviceLatestFlowLogDO::getLisAll, reqVO.getLisAll())
                .eqIfPresent(DeviceLatestFlowLogDO::getLisYear, reqVO.getLisYear())
                .eqIfPresent(DeviceLatestFlowLogDO::getListMonth, reqVO.getListMonth())
                .betweenIfPresent(DeviceLatestFlowLogDO::getLisTime, reqVO.getLisTime())
                .eqIfPresent(DeviceLatestFlowLogDO::getLisSun, reqVO.getLisSun())
                .eqIfPresent(DeviceLatestFlowLogDO::getLisSunAll, reqVO.getLisSunAll())
                .betweenIfPresent(DeviceLatestFlowLogDO::getLisSunTime, reqVO.getLisSunTime())
                .eqIfPresent(DeviceLatestFlowLogDO::getLisSunHour, reqVO.getLisSunHour())
                .eqIfPresent(DeviceLatestFlowLogDO::getHourBegin, reqVO.getHourBegin())
                .eqIfPresent(DeviceLatestFlowLogDO::getHourEnd, reqVO.getHourEnd())
                .betweenIfPresent(DeviceLatestFlowLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DeviceLatestFlowLogDO::getId));
    }

}